Skip to content

Conversation

@kenodegard
Copy link
Contributor

Description

Introduces a new lint action that replaces pre-commit.ci with prek, a fast Rust-based pre-commit runner.

Features

  • Lint checks - Runs prek against .pre-commit-config.yaml
  • Sticky PR comments - Shows lint errors and suggested fixes (git diff)
  • Autofix via comment - Maintainers/authors can trigger @conda-bot prek autofix to auto-commit fixes
  • Fork PR handling - Gracefully handles fork PRs where push isn't possible
  • Configurable - Python version, working directory, comment anchors, etc.

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 21, 2026
@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Jan 21, 2026
Introduces a new 'config' input to specify the path to the pre-commit config file in the lint action. Updates documentation and workflow to support this option, and renames test config files for consistency.
Introduces a new 'comment-on-success' input to the lint GitHub Action, allowing a success comment to be posted even if there were no prior lint failures. Updates documentation and workflow to support this feature, which is useful for testing and visibility.
@dbast
Copy link
Member

dbast commented Jan 21, 2026

@kenodegard I like prek and also use it in some repos. autofix is one thing, what do we do in regards to hook version bumps? role out renovate with the pre-commit manager enabled? With an org wide shared config like https://github.com/anaconda/renovate-config/blob/main/default.json? Also requires some harmonising with existing dependabot configs to avoid duplicated PRs.

@conda conda deleted a comment from conda-bot Jan 21, 2026
@conda conda deleted a comment from conda-bot Jan 21, 2026
@conda conda deleted a comment from conda-bot Jan 21, 2026
@conda conda deleted a comment from conda-bot Jan 21, 2026
@conda-bot
Copy link
Contributor

Warning

Working directory: lint/data/success
This is what the lint comment looks like when there are no lint issues.

✅ Lint issues fixed

All lint issues have been resolved.

See https://github.com/conda/actions/actions/runs/21216927394 for details.

@conda-bot
Copy link
Contributor

Warning

Working directory: lint/data/error
This is what the lint comment looks like when there are lint issues.

⚠️ Lint issues found

prek found issues that need to be fixed. You can either:

  1. Fix them locally and push
  2. Comment @conda-bot prek autofix to auto-commit fixes (requires write access)
# install prek: https://github.com/j178/prek?tab=readme-ov-file#installation
prek run --all-files
git add -A && git commit -m "style: auto-fix lint issues" && git push
🔍 prek output (click to expand)
ruff check...............................................................Failed
- hook id: ruff-check
- files were modified by this hook

  Fixed 2 errors:
  - lint/data/error/example.py:
      2 × F401 (unused-import)

  Found 2 errors (2 fixed, 0 remaining).
📝 Suggested fixes (click to expand)
diff --git a/lint/data/error/example.py b/lint/data/error/example.py
index 7bf344f..2d7612c 100644
--- a/lint/data/error/example.py
+++ b/lint/data/error/example.py
@@ -1,6 +1,4 @@
 # File with intentional lint issues (unused imports)
-import os
-import sys
 
 
 def hello():
See https://github.com/conda/actions/actions/runs/21216927394 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

5 participants